package LC;

import java.util.ArrayList;

/**
 * @ClassName LC.LC645
 * @Description: TODO
 * @Author hl
 * @Date 2020/5/19
 * @Version V1.0
 **/
public class LC645 {
    public static void main(String[] args) {
   String s="abcdef";
        System.out.println(s.substring(1,3));
    }
    public static  int[] findErrorNums(int[] nums) {
        ArrayList<Integer> list=new ArrayList<>();
        int num1=0;
        for(int i=0;i<nums.length;i++){
            if(!list.contains(nums[i])){
                list.add(nums[i]);
            }else{
                num1=nums[i];
            }
        }
        int num2=0;
        for(int i=0;i<nums.length;i++){
            if(!list.contains(i+1)){
                num2=i+1;
            }
        }
        int []result={num1,num2};
        return  result;

    }
}
